﻿using Luna.Data.CRM;

namespace Luna.Model.CRM
{
    internal class Contact : LunaReferenceEntity<IContactData>, IContact
    {
        public Contact(IContactData data)
            : base(data)
        {
        }

        protected Contact()
        {
        }

        protected Contact(Contact contact)
            : base(contact)
        {
        }

        public IAccount Account
        {
            get { return GetEntity(ApplicationModel.CRM.Accounts, Data.AccountID); }
        }

        public string Title
        {
            get { return Data.Title; }
        }

        public string Function
        {
            get { return Data.Function; }
        }

        public string Phone1
        {
            get { return Data.Phone1; }
        }

        public string Phone2
        {
            get { return Data.Phone2; }
        }

        public string Fax
        {
            get { return Data.Fax; }
        }

        public string Address
        {
            get { return Data.Address; }
        }

        public string ZipCode
        {
            get { return Data.ZipCode; }
        }

        public string City
        {
            get { return Data.City; }
        }

        public string Country
        {
            get { return Data.Country; }
        }

        public bool UseAccountInfos
        {
            get { return Data.UseAccountInfos; }
        }

        public IEditableContact EditableCopy
        {
            get { return new EditableContact(this); }
        }

        public string Name
        {
            get { return Data.Name; }
        }

        public string GivenName
        {
            get { return Data.GivenName; }
        }

        public string Mail
        {
            get { return Data.Mail; }
        }
    }
}